{% extends "base.html" %}

{% block title %}Stats{% endblock %}
{% block heading %}Statistics{% endblock %}

{% block content %}

	<h2>Overall stats</h2>
	<table>
		<tr class="standard">
			<td>Total ops:</td>
			<td align='right'>{{ stats.total_ops }}</td>
		</tr>
		<tr class="standard">
			<td>Paid ops:</td>
			<td align='right'>{{ stats.paid_ops }}</td>
		</tr>
		<tr class="standard">
			<td>First:</td>
			<td align='right'>{{ stats.date_first|date }}</td>
		</tr>
		<tr class="standard">
			<td>Last:</td>
			<td align='right'>{{ stats.date_last|date }}</td>
		</tr>
		<tr class="standard">
			<td>Elapsed days:</td>
			<td align='right'>{{ stats.elapsed_days }}</td>
		</tr>
		<tr class="standard">
			<td>Total ISK:</td>
			<td align='right'>{{ stats.total_isk_000 }}</td>
		</tr>		
		<tr class="standard">
			<td>Avg. ISK:</td>
			<td align='right'>{{ stats.ave_isk_000 }}</td>
		</tr>		
		<tr class="standard">
			<td>Avg. Pilots:</td>
			<td align='right'>{{ stats.ave_members|floatformat:2 }}</td>
		</tr>		
		<tr class="standard">
			<td>Avg. Pilot ISK:</td>
			<td align='right'>{{ stats.ave_pilot_isk_000 }}</td>
		</tr>	
		<tr class="standard">
			<td>My Ops:</td>
			<td align='right'>{{ stats.my_ops }}</td>
		</tr>	
		<tr class="standard">
			<td>My ISK:</td>
			<td align='right'>{{ stats.my_isk_000 }}</td>
		</tr>	
		<tr class="standard">
			<td>Ops per day:</td>
			<td align='right'>{{ stats.ops_per_day|floatformat:1 }}</td>
		</tr>	
		<tr class="standard">
			<td>ISK per day:</td>
			<td align='right'>{{ stats.corp_isk_per_day_000 }}</td>
		</tr>	
		<tr class="standard">
			<td>Unique FCs:</td>
			<td align='right'>{{ stats.fc_count }}</td>
		</tr>	
	</table>

	<h2>Last 7 days</h2>
	<table border="0">
		<tr class="standard">
			<td>Ops:</td>
			<td align='right'>{{ stats.last_week_ops }}</td>
		</tr>
		<tr class="standard">
			<td>ISK:</td>
			<td align='right'>{{ stats.last_week_isk_000 }}</td>
		</tr>
	</table>

	<h2>ISK per month</h2>
	<table border="0">
		<tr class="standard">
			<th align='left'>Month</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
		</tr>
		{% for month in stats.month_list %}
		<tr class="{% cycle odd,even%}">
			<td align='left'>{{month.name}}</td>
			<td align='left'>{{month.ops}}</td>
			<td align='right'>{{month.isk_000}}</td>
		</tr>
		{% endfor %}
	</table>

	<h2>Site stats</h2>
	<table border="0">
		<tr class="standard">
			<th align='left'>Site</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
		</tr>
		{% for stat in stats.site_map.values %}
		<tr class="{% cycle odd,even%}">
			<td align='left'>{{stat.site_name}}</td>
			<td align='right'>{{stat.ops}}</td>
			<td align='right'>{{stat.isk_000}}</td>
		</tr>
		{% endfor %}
	</table>


	<h2>Daily stats</h2>
	<table border="0">
		<tr class="standard">
			<th align='left'>Day</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
		</tr>
		{% for daily in stats.daily %}
		<tr class="{% cycle odd,even%}">
			<td align='left'>{{daily.day}}</td>
			<td align='right'>{{daily.ops}}</td>
			<td align='right'>{{daily.isk_000}}</td>
		</tr>
		{% endfor %}
	</table>


	<h2>Hourly stats</h2>
	<table border="0">
		<tr class="standard">
			<th align='left'>Hour</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
		</tr>
		{% for stat in stats.hourly %}
		<tr  class="{% cycle odd,even%}">
			<td align='left'>{{stat.hour}}</td>
			<td align='right'>{{stat.ops}}</td>
			<td align='right'>{{stat.isk_000}}</td>
		</tr>
		{% endfor %}
	</table>

	<h2>System stats</h2>
	<table border="0">
		<tr class="standard">
			<th align='left'>System</th>
			<th align='right'>Ops</th>
			<th align='right'>ISK</th>
		</tr>
		{% for system in stats.systems %}
		<tr  class="{% cycle odd,even%}">
			<td align='left'>{{ system.name }}</td>
			<td align='right'>{{ system.ops }}</td>
			<td align='right'>{{ system.isk_000 }}</td>
		</tr>
		{% endfor %}
	</table>

{% endblock %}
